package com.redoor.app.stake.workflow.commons;

import com.redoornetwork.framework.core.response.Status;

/**
 * 业务自定义错误状态，系统状态以1开头，自定义状态非1开头
 * Created by Floki on 2018/1/19.
 */
public enum WorkFlowStatus implements Status {
    LOGIN_AUTH_FAILED("20001","用户中心无用户返回"),
    LOGIN_AUTH_NOROLE("20002","用户无权限访问"),
    REDIS_NO_AUTH("20101", "Redis认证错误"),
    OTHER_EXCEPTION("99999","未知异常"),
    
    /*工单状态 : 原数据中工单状态是已 1 开头的,这里也定义成 1 开头*/
    WORKORDER_STATUS_FINISH("10005","已完成工单"),
    WORKORDER_STATUS_REJECT("10004","已拒绝工单"),
    WORKORDER_STATUS_ACCEPT("10002","已通过工单"),
    WORKORDER_STATUS_APPLYING("10001","审核中工单"),
    
    /*工单生命状态修改*/
    /*桩维护工单生成*/
    WORKORDER_LIFE_APPLY_CREATE("6001","APPLY_CREATE"),
    /*桩维护工单提交*/
    WORKORDER_LIFE_APPLY_SUBMIT("6002","APPLY_SUBMIT"),
    /*桩维护工单激活*/
    WORKORDER_LIFE_APPLY_ACTIVE("6003","APPLY_ACTIVE"),
    /*桩维护工单关闭*/
    WORKORDER_LIFE_APPLY_FINISH("6004","APPLY_FINISH"),

    /*注册码审核审核生成*/
    WORKORDER_LIFE_REG_CREATE("6005","REG_CREATE"),
    /*注册码审核审核通过*/
    WORKORDER_LIFE_REG_ACCEPT("6006","REG_ACCEPT"),
    /*注册码审核审核拒绝*/
    WORKORDER_LIFE_REG_REJECT("6007","REG_REJECT"),

    /*桩维护审核生成*/
    WORKORDER_LIFE_CHARGE_CREATE("6008","CHARGE_CREATE"),
    /*桩维护审核通过*/
    WORKORDER_LIFE_CHARGE_ACCEPT("6009","CHARGE_ACCEPT"),
    /*桩维护审核拒绝*/
    WORKORDER_LIFE_CHARGE_REJECT("6010","CHARGE_REJECT"),
    /*桩维护审核工单激活*/
    WORKORDER_LIFE_CHARGE_ACTIVE("6011","CHARGE_ACTIVE"),


    /*检查目标工单状态返回值*/
    TARGET_WORKORDER_NOT_EXIST("30001","目标工单不存在"),
    TARGET_WORKORDER_AUDITED("30002","目标工单已审核"),
    TARGET_WORKORDER_NOT_AUDITED("30003","目标工单未审核"),
    TARGET_WORKORDER_ILLEGAL("30004","目标工单状态不正常"),

    /*工单审核状态*/
    AUDITED_SUCCESS("40001","审核成功"),
    AUDITED_FAIL("40002","审核失败"),

    /*工单种类 : code值会保存到数据库*/
    WORKORDER_TARGET_TYPE_REGISTRATIONAPPLY("registrationApply","注册码申请"),
    WORKORDER_TARGET_TYPE_MAINTENANCEAPPLY("maintenanceApply","桩维护申请"),
    WORKORDER_TARGET_TYPE_MAINTENANCECHARGE("maintenaceCharge","桩维护审核"),

    PARAM_IS_EMPTY("50002","参数为空"),

    ;

    private String code;
    private String message;

    WorkFlowStatus(String code, String message) {
        this.code = code;
        this.message = message;
    }

    @Override
    public String getCode() {
        return code;
    }

    @Override
    public String getMessage() {
        return message;
    }
}
